const http=require('http')
const app=http.createServer()
app.on('request',(req,res)=>{
    var url=req.url;
    res.setHeader('Content-type','text/html,charset-utf8')
    if(url=='/'){
        res.end('欢迎')
    }else if(url=='/about'){
        res.end('关于页面的内容')
    }else if(url=='/contcat'){
        res.end('联系页面内容')
    }else{
        res.end('错误')
    }
})
app.listen(3000,()=>{
    console.log('server is running...');
})